package com.nats.sample.quickstart._01;

import com.nats.sample.common.util.NatsConnUtil;
import io.nats.client.Connection;
import java.nio.charset.StandardCharsets;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class _01NatsPubTestMain {

  public static void main(String[] args) throws Exception {
    log.info("publish start");
    Connection nc = NatsConnUtil.getConn();
    nc.publish("hello", "hello world".getBytes(StandardCharsets.UTF_8));
    log.info("publish send success ");
  }

}
